function ts_orient(x1,y1,x2,y2,x3,y3:longint):longint;
begin
result:=(x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2);
end;

function ts(x1,y1,x2,y2,x3,y3:longint):double;
begin
result:=abs((x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2))/2);
end;